package client;

import com.leuville.asyncmeteoservice.AsyncMeteoService;
import com.leuville.asyncmeteoservice.AsyncMeteoService_Service;
import com.leuville.asyncmeteoservice.GetClient;
import com.leuville.asyncmeteoservice.RequeteMeteo;
import com.leuville.asyncmeteoservice.SituationMeteo;

public class Client {

	public static void main(String[] args) {
		AsyncMeteoService_Service fs = new AsyncMeteoService_Service();
		AsyncMeteoService service = fs.getAsyncMeteoServiceSOAP();
		
		RequeteMeteo requete = new RequeteMeteo();
		requete.setClient("toto");
		requete.setPays("China");
		requete.setVille("Beijing");
		
		RequeteMeteo requete1 = new RequeteMeteo();
		requete1.setClient("titi");
		requete1.setPays("China");
		
		service.deposerRequete(requete);
		service.deposerRequete(requete1);
		GetClient client = new GetClient();
		client.setClient("toto");
		GetClient client1 = new GetClient();
		client1.setClient("titi");
		try {
			Thread.sleep(5 * 1000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
		SituationMeteo reponse = service.obtenirSituationMeteo(client);
		SituationMeteo reponse1 = service.obtenirSituationMeteo(client1);
		
		System.out.println("Information:" + reponse.getReponseMeteo().getMeteo().getCiel());
		System.out.println("Information1:" + reponse1.getReponseMeteo().getMeteo().getCiel());
	}
}
